﻿// <copyright file="CustomCollectionChangedEventArgs.cs" company="Ucaya">
// </copyright>
// <author>Ucaya</author>

namespace KinectExtensions.Collections.ObjectModel
{
    #region

    using System;
    using System.Collections;
    using System.Collections.Specialized;

    #endregion

    public class CustomCollectionChangedEventArgs : EventArgs
    {
        #region Constructors and Destructors

        public CustomCollectionChangedEventArgs(NotifyCollectionChangedAction action)
        {
            this.Action = action;
        }

        public CustomCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList newItems, IList oldItem, int newStartingIndex, int oldStartingIndex)
        {
            this.Action = action;
            this.NewItems = newItems;
            this.OldItems = oldItem;
            this.NewStartingIndex = newStartingIndex;
            this.OldStartingIndex = oldStartingIndex;
        }

        #endregion

        // Summary:
        //     Gets the description of the action that caused the event.
        //
        // Returns:
        //     The description of the action that caused the event, as a value of the enumeration.

        #region Public Properties

        public NotifyCollectionChangedAction Action { get; private set; }

        //
        // Summary:
        //     Gets the items affected by an action.
        //
        // Returns:
        //     The list of items affected by an action. The default is null.
        public IList NewItems { get; private set; }

        //
        // Summary:
        //     Gets the index at which the change occurred.
        //
        // Returns:
        //     The index at which the change occurred.
        public int NewStartingIndex { get; private set; }

        //
        // Summary:
        //     Gets the item affected by a System.Collections.Specialized.NotifyCollectionChangedAction.Replace
        //     or System.Collections.Specialized.NotifyCollectionChangedAction.Remove action.
        //
        // Returns:
        //     The list of items affected by a System.Collections.Specialized.NotifyCollectionChangedAction.Replace
        //     or System.Collections.Specialized.NotifyCollectionChangedAction.Remove action.
        public IList OldItems { get; private set; }

        //
        // Summary:
        //     Gets the index at which the change occurred for a System.Collections.Specialized.NotifyCollectionChangedAction.Replace
        //     or System.Collections.Specialized.NotifyCollectionChangedAction.Remove action.
        //
        // Returns:
        //     The index at which the change occurred for a System.Collections.Specialized.NotifyCollectionChangedAction.Replace
        //     or System.Collections.Specialized.NotifyCollectionChangedAction.Remove action.
        public int OldStartingIndex { get; private set; }

        #endregion
    }
}